package com.nd.mobile.study.domain;

import java.io.Serializable;

import android.os.Bundle;

import com.fuckhtc.gson.Gson;
import com.fuckhtc.gson.annotations.SerializedName;
import com.fuckhtc.gson.reflect.TypeToken;
import com.nd.mobile.study.common.config.Commands;
import com.nd.mobile.study.common.config.ReqParam;
import com.nd.mobile.study.common.util.HttpRequestUtil;

public class AttentionCatalog implements Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 1L;

	@SerializedName("RemindID")
	private String id;
	
	@SerializedName("RemindTitle")
	private String title;
	
	@SerializedName("AddTime")
	private String addTime;

	public String getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public String getAddTime() {
		return addTime;
	}
	
	public AttentionDetail getDetail(User user) throws Exception{
		Bundle data = new Bundle();
		data.putString(ReqParam.COMMON_USER_ID, user.getUserId());
		data.putString(ReqParam.ATTENTION_ID, this.id);
		String jsonData = HttpRequestUtil.get(Commands.GET_ATTENTION_DETAIL, data);
		Result<AttentionDetail[]> result = new Gson().fromJson(jsonData, new TypeToken<Result<AttentionDetail[]>>(){}.getType());
		return result.getBody()[0];
	}
	
}
